package com.holyland.util;

import org.apache.commons.lang.StringUtils;

public enum Identity {
	KTP("K", "KTP"), SIM("S", "SIM"), PASSPORT("P", "Passpor");
	
	private String code;
	private String desc;
	
	private Identity(String type, String desc) {
		this.code = type;
		this.desc = desc;
	}

	public String getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}		
	
	public static String getDesc(String code) {
		String desc = "";
		
		if(StringUtils.equals("K", code)) {
			 desc = KTP.getDesc();
		} else if(StringUtils.equals("S", code)) {
			desc = SIM.getDesc();
		} else if(StringUtils.equals("P", code)) {
			desc = PASSPORT.getDesc();
		}
		
		return desc;
	}
		
}
